<template>
  <div class="home">
    <img alt="Vue logo" src="../assets/logo.png" />
    <HelloWorld msg="Welcome to Your Vue.js App" />
  </div>
</template>

<script>
// @ is an alias to /src
import HelloWorld from "@/components/HelloWorld.vue";

export default {
  data() {
    return {
      arr: [
        { name: "前", state: 1 },
        { name: "前2", state: 0 },
        { name: "前3", state: 2 },
        { name: "前4", state: 0 },
        { name: "前5", state: 1 },
        { name: "前6", state: 2 },
        { name: "前7", state: 0 },
      ],
    };
  },
  name: "Home",
  mounted() {
    let arr1 = this.arr.filter((item) => {
      return item.state == 2;
    });
    console.log(arr1.length);
  },
  components: {
    HelloWorld,
  },
};
</script>
